﻿using System.Threading;
using HelloWorld.ViewModels.Home;
using Phoenix;
using Phoenix.ActionResults;
using Phoenix.Framework;

namespace HelloWorld.Controllers
{
    public class LoginController : Controller
    {
        public ActionResult Login()
        {
            return Page(new LoginViewModel());
        }

        public ActionResult Login(bool success)
        {
            Thread.Sleep(1000);

            var menu = new MenuItem{ ControllerAction = "adsa"};
            if (success)
                return RedirectTo("Main.Home", menu);

            return MessageBox("Login failed");
        }
    }
}